#ifndef TEMPLATED__STRING__GEN
#define TEMPLATED__STRING__GEN

#include <unordered_map>
#include <LitString.h>

template<typename EnumType, typename EnumTraits = unsigned short, EnumTraits ERROR_VAL = 0 >
class EnumMap
{
public:
	typename typedef EnumType									Type;
	typename typedef EnumTraits									Traits;
	typename typedef std::unordered_map<EnumType, Lit::String>	Map;

	static const EnumTraits ErrorValue = ERROR_VAL;
};

template<typename EnumType, typename EnumTraits = unsigned short, EnumTraits ERROR_VAL = 0>
class EnumStr
{
public:
	typename typedef EnumMap<EnumType,EnumTraits>::Map			Map;
	typename typedef EnumMap<EnumType,EnumTraits>::Type			Type;
	typename typedef EnumMap<EnumType,EnumTraits>::Traits		Traits;

	static const Traits ErrorValue = ERROR_VAL;

protected:
	static Map map;
public:
	EnumStr(){}
	~EnumStr(){}
	
	bool hasTranslation( Type t ) const{ return map.find(t) != map.end(); }
	Traits size() const{ return map.size(); }

	Type& operator[]( Type val ){ return map[val]; }
	const Type& operator[]( Type val ) const{ return map.at(val); }


};

#endif
